'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.controllerRegister.controllerRegister);
  router.get('/commit', controller.controllerRegister.test);
  router.get('/login', controller.controllerLogin.judgeLogin);

  router.get('/excel', controller.controllerExcel.excelPage);
  router.post('/uploadExcel', controller.controllerExcel.uploadExcel); 

  router.get('/getExcelJosn', controller.controllerExcel.getExcelJosn);
  router.post('/addOneExcel', controller.controllerExcel.addOneExcel);
  router.post('/updateExcel', controller.controllerExcel.updateExcel);
  router.get('/deleteExcel', controller.controllerExcel.deleteExcel); 

  router.get('/deleteTable', controller.controllerExcel.deleteTable); 
  
  router.get('/gameUser', controller.controllerExcel.gameUser);  
};

/**
CREATE TABLE IF NOT EXISTS `gameUser`( `id` INT UNSIGNED AUTO_INCREMENT,
   `name` VARCHAR(50),
   `fp` VARCHAR(50),
   `desc` VARCHAR(100), 
    PRIMARY KEY ( `id` ) )ENGINE=InnoDB DEFAULT CHARSET=utf8;  
 CREATE TABLE IF NOT EXISTS `gamePlay`( `id` INT UNSIGNED AUTO_INCREMENT,
   `name` VARCHAR(50),
   `fp` VARCHAR(50),
   `date` DATE,
   `money` int,
   `type` VARCHAR(50), 
   `code` VARCHAR(50), 
   `q1` VARCHAR(10),
   `q2` VARCHAR(10),
   `q3` VARCHAR(10),
   `q4` VARCHAR(10),
   `q5` VARCHAR(10), 
    PRIMARY KEY ( `id` ) )ENGINE=InnoDB DEFAULT CHARSET=utf8;  
 */